Public Class CategoryCollection : Inherits System.Configuration.Provider.ProviderCollection

    Public ReadOnly Property CodeDecodeProvider(ByVal name As String) As CategoryProvider
        Get
            Dim o As Object = Me(name)
            If o IsNot Nothing Then
                Return CType(o, CategoryProvider)
            Else
                Return Nothing
            End If
        End Get
    End Property

    Public Overrides Sub Add(ByVal provider As System.Configuration.Provider.ProviderBase)
        If (provider Is Nothing) Then
            Throw New ArgumentNullException(("The provider parameter cannot be null."))
        End If
        If Not (TypeOf (provider) Is CategoryProvider) Then
            Throw New ArgumentException(("The provider parameter must be of type CategoryProvider."))
        End If
        MyBase.Add(provider)
    End Sub

End Class
